/***************************************************************************************************
 *Copyright(C),2021-2026,Sumscope
 *FileName    :  PanoramicDataCenter.h
 *Author    :  shangyi.xin
 *Version    :  1.0
 *Date        :  2021/04/09
 *Desc        :  //用于主要说明此程序文件完成的主要功能
 *Relation :
 *Others    :  //其他内容说明
 *Function :  //主要函数列表，每条记录应包含函数名及功能简要说明
 *History    :
 * //修改历史记录列表，每条修改记录应包含修改日期、修改者及修改内容简介
 ***************************************************************************************************/
#pragma once
#include <core/singleton.h>
#include <core/sync/lock.h>

#include "PanoramicBondDealContainer.h"
#include "PanoramicBondDealStruct.h"

class S_BONDLIB_EXPORT CPanoramicDataCenter
    : public qb::base::Singleton<CPanoramicDataCenter> {  // 无锁结构
 public:
  CPanoramicDataCenter();
  qb::base::CSLock& GetLock(bool bForceToday);
  bool ChangeDate(int date);
  unsigned int GetDate() { return m_nCurrentDate; }
  void ReloadData();
  bool IsHistoryDate();

  void GetDisChartData(int nType, time_t tNow, CDealDisChartList& data,
                       bool eng = false);
  CPanoramicBondDealMap& GetDealMap(bool bForceToday);

 protected:
  virtual void initialize();
  void ReloadHisContainer();

 private:
  unsigned int m_nCurrentDate;
  CPanoramicBondDealContainer m_hisContainer;
};